<html>
<head><meta charset="utf-8"><title>escaped sequences are handled twice · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/escaped.20sequences.20are.20handled.20twice.html">escaped sequences are handled twice</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163942933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/escaped%20sequences%20are%20handled%20twice/near/163942933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/escaped.20sequences.20are.20handled.20twice.html#163942933">(Apr 22 2019 at 22:05)</a>:</h4>
<p>I've noticed that we have two set of codes for handling escape sequences:</p>
<ul>
<li><a href="https://github.com/rust-lang/rust/blob/c21fbfe7e310b9055ed6b7c46b7d37b831a516e3/src/libsyntax/parse/lexer/mod.rs#L928-L1065" target="_blank" title="https://github.com/rust-lang/rust/blob/c21fbfe7e310b9055ed6b7c46b7d37b831a516e3/src/libsyntax/parse/lexer/mod.rs#L928-L1065">in the lexer</a></li>
<li><a href="https://github.com/rust-lang/rust/blob/c21fbfe7e310b9055ed6b7c46b7d37b831a516e3/src/libsyntax/parse/mod.rs#L313-L366" target="_blank" title="https://github.com/rust-lang/rust/blob/c21fbfe7e310b9055ed6b7c46b7d37b831a516e3/src/libsyntax/parse/mod.rs#L313-L366">in the parser</a></li>
</ul>
<p>Is there a deep reason why we should do it twice? Or is it that nobody bothered with removing the duplication?</p>



<a name="163969048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/escaped%20sequences%20are%20handled%20twice/near/163969048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/escaped.20sequences.20are.20handled.20twice.html#163969048">(Apr 23 2019 at 07:43)</a>:</h4>
<p>probably the latter?</p>



<a name="164170288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/escaped%20sequences%20are%20handled%20twice/near/164170288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/escaped.20sequences.20are.20handled.20twice.html#164170288">(Apr 25 2019 at 13:37)</a>:</h4>
<p>Started to work on this in <a href="https://github.com/rust-lang/rust/pull/60261" target="_blank" title="https://github.com/rust-lang/rust/pull/60261">https://github.com/rust-lang/rust/pull/60261</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>